﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.WorkItemTracking.Client;
using Microsoft.TeamFoundation.VersionControl.Client;

namespace TFSCodeReviewHelper
{
    public class TFSInterface
    {
        static TeamFoundationServer Server;
        static WorkItemStore WorkItemStore;
        static VersionControlServer VersionControlServer;

        public static void ConnectToServer()
        {
            RegisteredProjectCollection[] collections = RegisteredTfsConnections.GetLegacyProjectCollections();
            

            foreach (RegisteredProjectCollection collection in collections)
            {
                try
                {
                    TfsTeamProjectCollection co = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(collection);


                }
                catch (Exception e)
                {
                    
                }
            }

            collections = RegisteredTfsConnections.GetProjectCollections();

            foreach (RegisteredProjectCollection collection in collections)
            {
                try
                {
                    TfsTeamProjectCollection co = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(collection);

                    //Server.GetService(typeof(WorkItemStore));
                }
                catch (Exception e)
                {

                }
            }

        }

    }
}
